package com.airlines.basedata.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.airlines.base.service.base.impl.BaseServiceImpl;
import com.airlines.basedata.dao.DataDectionaryMapper;
import com.airlines.basedata.domain.Tbasdic;
import com.airlines.basedata.service.DataDectionarySercice;
import com.airlines.common.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
/**
 * 数据字典imp层
 * @author hjj
 *2018年9月18日
 */
@Service
public class DataDectionarySerciceImpl extends BaseServiceImpl<Tbasdic, String> implements DataDectionarySercice{

	  @Autowired
	    private DataDectionaryMapper dataDectionaryDao;

	@Override
	public void setBaseMapper() {
		 super.setBaseMapper(dataDectionaryDao);
		
	}

	@Override
	public List<Tbasdic> queryList() {
		List<Tbasdic> list=dataDectionaryDao.selectByQuery();
		return list;
	}

	@Override
	public Page list(Tbasdic tbasdic, Page page) {
		PageHelper.startPage(page.getPageNumber(), page.getPageSize());
        List<Tbasdic> list = dataDectionaryDao.listLimit(tbasdic);
        PageInfo<Tbasdic> pageInfo = new PageInfo<Tbasdic>(list);
        page.setTotal(String.valueOf(pageInfo.getTotal()));
        page.setRows(pageInfo.getList());
        return page;
	}

	

}
